package com.ruoyi.monitor.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.monitor.mapper.MonitorApprovalRecordMapper;
import com.ruoyi.monitor.domain.MonitorApprovalRecord;
import com.ruoyi.monitor.service.IMonitorApprovalRecordService;

/**
 * 审批记录Service业务层处理
 * 
 * @author cl
 * @date 2025-04-16
 */
@Service
public class MonitorApprovalRecordServiceImpl implements IMonitorApprovalRecordService 
{
    @Autowired
    private MonitorApprovalRecordMapper monitorApprovalRecordMapper;

    /**
     * 查询审批记录
     * 
     * @param recordId 审批记录主键
     * @return 审批记录
     */
    @Override
    public MonitorApprovalRecord selectMonitorApprovalRecordByRecordId(Integer recordId)
    {
        return monitorApprovalRecordMapper.selectMonitorApprovalRecordByRecordId(recordId);
    }

    /**
     * 查询审批记录列表
     * 
     * @param monitorApprovalRecord 审批记录
     * @return 审批记录
     */
    @Override
    public List<MonitorApprovalRecord> selectMonitorApprovalRecordList(MonitorApprovalRecord monitorApprovalRecord)
    {
        return monitorApprovalRecordMapper.selectMonitorApprovalRecordList(monitorApprovalRecord);
    }

    /**
     * 新增审批记录
     * 
     * @param monitorApprovalRecord 审批记录
     * @return 结果
     */
    @Override
    public int insertMonitorApprovalRecord(MonitorApprovalRecord monitorApprovalRecord)
    {
        monitorApprovalRecord.setCreateTime(DateUtils.getNowDate());
        return monitorApprovalRecordMapper.insertMonitorApprovalRecord(monitorApprovalRecord);
    }

    /**
     * 修改审批记录
     * 
     * @param monitorApprovalRecord 审批记录
     * @return 结果
     */
    @Override
    public int updateMonitorApprovalRecord(MonitorApprovalRecord monitorApprovalRecord)
    {
        return monitorApprovalRecordMapper.updateMonitorApprovalRecord(monitorApprovalRecord);
    }

    /**
     * 批量删除审批记录
     * 
     * @param recordIds 需要删除的审批记录主键
     * @return 结果
     */
    @Override
    public int deleteMonitorApprovalRecordByRecordIds(Integer[] recordIds)
    {
        return monitorApprovalRecordMapper.deleteMonitorApprovalRecordByRecordIds(recordIds);
    }

    /**
     * 删除审批记录信息
     * 
     * @param recordId 审批记录主键
     * @return 结果
     */
    @Override
    public int deleteMonitorApprovalRecordByRecordId(Integer recordId)
    {
        return monitorApprovalRecordMapper.deleteMonitorApprovalRecordByRecordId(recordId);
    }
}
